package com.java2405.first.luoyang_management.effective_population_management.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.java2405.first.luoyang_management.effective_population_management.entity.Manager;
import com.java2405.first.luoyang_management.effective_population_management.mapper.ManagerMapper;
import com.java2405.first.luoyang_management.effective_population_management.service.IManagerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zzh
 * @since 2025-03-14
 */
@Transactional
@Service
public class ManagerServiceImpl extends ServiceImpl<ManagerMapper, Manager> implements IManagerService {
    @Resource
    private ManagerMapper managerMapper;
    public Manager getManager(String account, String password) {
        QueryWrapper<Manager> queryManager = new QueryWrapper<>();
        queryManager.eq("account",account).eq("password",password);

        Manager manager = managerMapper.selectOne(queryManager);
        if (manager == null) {
            return null;
        }

        return manager;
    }
}
